package com.ziyun.pop.modules.capital.entity;

import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.ziyun.pop.common.e.order.OrderInfoStatusEnum;
import com.ziyun.pop.common.utils.EnumUtil;
import io.renren.common.utils.StringUtil;

import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;

/**
 * 
 * 
 * @author zh
 * @email 296588519@qq.com
 * @date 2018-08-03 10:21:15
 */
@TableName("merchant_order_account")
public class MerchantOrderAccountEntity implements Serializable {
	private static final long serialVersionUID = 1L;

	/**
	 * 订单金额id
	 */
	@TableId
	private Integer orderAccountId;
	/**
	 * 分配订单id
	 */
	private String orderAllotId;
	/**
	 * 订单id
	 */
	private String orderId;
	/**
	 * 会员用户名
	 */
	private Integer memberId;

	/**
	 *  商户id
	 */
	private Integer sellerId;

	/**
	 * 商家名称
	 */
	private String sellerName;

	/**
	 * 商户类型 (0 小b  1工厂)
	 */
	private Integer merchantType;


	/**
	 * 订单状态:active:活动订单,dead:已作废,finish:已完成,unactive:未激活,cancel:已取消
	 */
	private String status;
	/**
	 * 订单来源'pc','wap','weixin','ios','android','jd','taobao','suning','tmall','erp'
	 */
	private String source;
	/**
	 * 商品总值
	 */
	private BigDecimal totalAmount;
	/**
	 * 配送费用
	 */
	private BigDecimal costFreight;
	/**
	 * 调价
	 */
	private BigDecimal discount;
	/**
	 * 商品促销优惠
	 */
	private BigDecimal pmtGoods;
	/**
	 * 优惠卷优惠
	 */
	private BigDecimal pmtOrder;
	/**
	 * 随机立减
	 */
	private BigDecimal pmtRandom;
	/**
	 * 订单应付金额
	 */
	private BigDecimal payableAmount;
	/**
	 * 订单已支付金额
	 */
	private BigDecimal payed;
	/**
	 * 下单时间
	 */
	private Date orderCreateTime;
	/**
	 * 收货时间
	 */
	private Date receivedTime;
	/**
	 * 支付时间
	 */
	private Date paymentTime;
	/**
	 * 支付方式
	 */
	private String payment;
	/**
	 * 是否分配 1是0 不是
	 */
	private Integer isAllot;
	/**
	 * 打款状态0: 未打款 1：已打款
	 */
	private Integer fundState;
	/**
	 * 打款时间
	 */
	private Date fundTime;
	/**
	 * 单据创建时间
	 */
	private Date createTime;

	/**
	 * 设置：订单金额id
	 */
	public void setOrderAccountId(Integer orderAccountId) {
		this.orderAccountId = orderAccountId;
	}
	/**
	 * 获取：订单金额id
	 */
	public Integer getOrderAccountId() {
		return orderAccountId;
	}
	/**
	 * 设置：分配订单id
	 */
	public void setOrderAllotId(String orderAllotId) {
		this.orderAllotId = orderAllotId;
	}
	/**
	 * 获取：分配订单id
	 */
	public String getOrderAllotId() {
		return orderAllotId;
	}
	/**
	 * 设置：订单id
	 */
	public void setOrderId(String orderId) {
		this.orderId = orderId;
	}
	/**
	 * 获取：订单id
	 */
	public String getOrderId() {
		return orderId;
	}
	/**
	 * 设置：会员用户名
	 */
	public void setMemberId(Integer memberId) {
		this.memberId = memberId;
	}
	/**
	 * 获取：会员用户名
	 */
	public Integer getMemberId() {
		return memberId;
	}

	public Integer getSellerId() {
		return sellerId;
	}

	public void setSellerId(Integer sellerId) {
		this.sellerId = sellerId;
	}

	public String getSellerName() {
		return sellerName;
	}

	public void setSellerName(String sellerName) {
		this.sellerName = sellerName;
	}

	public Integer getMerchantType() {
		return merchantType;
	}

	public void setMerchantType(Integer merchantType) {
		this.merchantType = merchantType;
	}

	/**
	 * 设置：订单状态:active:活动订单,dead:已作废,finish:已完成,unactive:未激活,cancel:已取消
	 */
	public void setStatus(String status) {
		this.status = status;
	}
	/**
	 * 获取：订单状态:active:活动订单,dead:已作废,finish:已完成,unactive:未激活,cancel:已取消
	 */
	public String getStatus() {
		return status;
	}

	public String getStatusText (){
	    return EnumUtil.getEnumByCode(OrderInfoStatusEnum.class , this.status).toDescribe();
    }

	/**
	 * 设置：订单来源'pc','wap','weixin','ios','android','jd','taobao','suning','tmall','erp'
	 */
	public void setSource(String source) {
		this.source = source;
	}
	/**
	 * 获取：订单来源'pc','wap','weixin','ios','android','jd','taobao','suning','tmall','erp'
	 */
	public String getSource() {
		return source;
	}
	/**
	 * 设置：商品总值
	 */
	public void setTotalAmount(BigDecimal totalAmount) {
		this.totalAmount = totalAmount;
	}
	/**
	 * 获取：商品总值
	 */
	public BigDecimal getTotalAmount() {
		return totalAmount;
	}
	/**
	 * 设置：配送费用
	 */
	public void setCostFreight(BigDecimal costFreight) {
		this.costFreight = costFreight;
	}
	/**
	 * 获取：配送费用
	 */
	public BigDecimal getCostFreight() {
		return costFreight;
	}
	/**
	 * 设置：调价
	 */
	public void setDiscount(BigDecimal discount) {
		this.discount = discount;
	}
	/**
	 * 获取：调价
	 */
	public BigDecimal getDiscount() {
		return discount;
	}
	/**
	 * 设置：商品促销优惠
	 */
	public void setPmtGoods(BigDecimal pmtGoods) {
		this.pmtGoods = pmtGoods;
	}
	/**
	 * 获取：商品促销优惠
	 */
	public BigDecimal getPmtGoods() {
		return pmtGoods;
	}
	/**
	 * 设置：优惠卷优惠
	 */
	public void setPmtOrder(BigDecimal pmtOrder) {
		this.pmtOrder = pmtOrder;
	}
	/**
	 * 获取：优惠卷优惠
	 */
	public BigDecimal getPmtOrder() {
		return pmtOrder;
	}
	/**
	 * 设置：随机立减
	 */
	public void setPmtRandom(BigDecimal pmtRandom) {
		this.pmtRandom = pmtRandom;
	}
	/**
	 * 获取：随机立减
	 */
	public BigDecimal getPmtRandom() {
		return pmtRandom;
	}
	/**
	 * 设置：订单应付金额
	 */
	public void setPayableAmount(BigDecimal payableAmount) {
		this.payableAmount = payableAmount;
	}
	/**
	 * 获取：订单应付金额
	 */
	public BigDecimal getPayableAmount() {
		return payableAmount;
	}
	/**
	 * 设置：订单已支付金额
	 */
	public void setPayed(BigDecimal payed) {
		this.payed = payed;
	}
	/**
	 * 获取：订单已支付金额
	 */
	public BigDecimal getPayed() {
		return payed;
	}
	/**
	 * 设置：下单时间
	 */
	public void setOrderCreateTime(Date orderCreateTime) {
		this.orderCreateTime = orderCreateTime;
	}
	/**
	 * 获取：下单时间
	 */
	public Date getOrderCreateTime() {
		return orderCreateTime;
	}
	/**
	 * 设置：收货时间
	 */
	public void setReceivedTime(Date receivedTime) {
		this.receivedTime = receivedTime;
	}
	/**
	 * 获取：收货时间
	 */
	public Date getReceivedTime() {
		return receivedTime;
	}
	/**
	 * 设置：支付时间
	 */
	public void setPaymentTime(Date paymentTime) {
		this.paymentTime = paymentTime;
	}
	/**
	 * 获取：支付时间
	 */
	public Date getPaymentTime() {
		return paymentTime;
	}
	/**
	 * 设置：支付方式
	 */
	public void setPayment(String payment) {
		this.payment = payment;
	}
	/**
	 * 获取：支付方式
	 */
	public String getPayment() {
		return payment;
	}
	/**
	 * 设置：是否分配 1是0 不是
	 */
	public void setIsAllot(Integer isAllot) {
		this.isAllot = isAllot;
	}
	/**
	 * 获取：是否分配 1是0 不是
	 */
	public Integer getIsAllot() {
		return isAllot;
	}

	public String getIsAllotText() {
		return StringUtil.isNotNull(this.orderAllotId) ? "是":"否";
	}
	/**
	 * 设置：打款状态0: 未打款 1：已打款
	 */
	public void setFundState(Integer fundState) {
		this.fundState = fundState;
	}
	/**
	 * 获取：打款状态0: 未打款 1：已打款
	 */
	public Integer getFundState() {
		return fundState;
	}

	public String getFundStateText(){
		return this.fundState.intValue() == 1 ? "已打款": "未打款";
	}
	/**
	 * 设置：打款时间
	 */
	public void setFundTime(Date fundTime) {
		this.fundTime = fundTime;
	}
	/**
	 * 获取：打款时间
	 */
	public Date getFundTime() {
		return fundTime;
	}
	/**
	 * 设置：单据创建时间
	 */
	public void setCreateTime(Date createTime) {
		this.createTime = createTime;
	}
	/**
	 * 获取：单据创建时间
	 */
	public Date getCreateTime() {
		return createTime;
	}
}
